package cn.hdu.liang.generics;


import cn.hdu.liang.generics.watercolors.Watercolors;

import java.util.EnumSet;
import java.util.Set;

import static cn.hdu.liang.generics.watercolors.Watercolors.*;
import static net.mindview.util.Sets.*;

public class WatercolorSets {
    public static void main(String[] args) {
        Set<Watercolors> set1 = EnumSet.range(BRILLIANT_RED, VIRIDIAN_HUE);
        Set<Watercolors> set2 = EnumSet.range(CERULEAN_BLUE_HUE, BURNT_UMBER);
        System.out.println("set1 : " + set1);
        System.out.println("set2 : " + set2);
        System.out.println("并集 : " + union(set1, set2));

        Set<Watercolors> subset = intersection(set1, set2);
        System.out.println("交集: " + subset);

        System.out.println("set1移除subset: " + difference(set1, subset));
        System.out.println("set2移除subset: " + difference(set2, subset));

        System.out.println("set1补集: " + complement(set1, subset));

    }
}
